package com.afb;

class User {

	String login
	String password
	String role = "Registered"

	String name
	String mobile
	String tel
        String email
	String address

    static constraints = {
		login(blank: false, size: 4..20, unique:true)
		password(blank: false, size: 4..20, password:true)
//		role(inList:["Registered", "Supplier", "Director", "Administrator"])
		role(inList:["Registered", "Administrator"])
		name()
		mobile()
		tel(nullable: true)
                email(email:true, blank:false)
		address(nullable: true)
    }

	String toString(){
		name +" (" +role + ")"
	}

}
